{{ define "header.html"}}

<!DOCTYPE html>
<html lang="en" data-bs-theme="{{ .Config.Color }}">
<head>
    <title>Exercise Diary</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--Favicon-->
    <link rel="icon" type="image/x-icon" href="/fs/public/favicon.png">
    {{ if eq .Config.NodePath "" }}
    <!-- Font for icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css">
    <!-- Bootstrap and theme -->
    <link href="https://cdn.jsdelivr.net/gh/aceberg/aceberg-bootswatch-fork@v5/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
    <!-- JavaScript Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1"></script>
    <script src="https://cdn.jsdelivr.net/npm/chartjs-chart-matrix@2.0.1"></script>
    {{ else }} <!-- Local node_modules -->
    <link rel="stylesheet" href="{{ .Config.NodePath }}/node_modules/bootstrap-icons/font/bootstrap-icons.css">
    <link href="{{ .Config.NodePath }}/node_modules/bootswatch/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
    <script src="{{ .Config.NodePath }}/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{{ .Config.NodePath }}/node_modules/chart.js/dist/chart.umd.js"></script>
    <script src="{{ .Config.NodePath }}/node_modules/chartjs-chart-matrix/dist/chartjs-chart-matrix.min.js"></script>
    {{ end }}
</head>
<body>
  <nav class="navbar navbar-expand-md navbar-dark bg-primary">
    <div class="container-lg">
      <ul class="navbar-nav">
        <li class="nav-item">
            <a class="nav-link active" href="/">
                <img src="data:image/png;base64, {{ .Config.Icon }}" style="width: 2em"/>
            </a>
        </li>
        <li class="nav-item dropdown">
            <a class="nav-link active dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                <i class="bi bi-list"></i>
            </a>
            <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="/exercise/?id=new">Add Exercise</a></li>
                <li><hr class="dropdown-divider"></li>
                <li><a class="dropdown-item" href="/stats/">Stats</a></li>
                <li><a class="dropdown-item" href="/weight/">Weight</a></li>
                <li><hr class="dropdown-divider"></li>
                <li><a class="dropdown-item" href="/config/">Config</a></li>
            </ul>
        </li>
      </ul>
        <!-- <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link active fs-3 ms-md-2" target="_blank" href="https://github.com/aceberg/ExerciseDiary"><i class="bi bi-github"></i></a>
            </li>
        </ul> -->
    </div>
  </nav>
{{ end }}